import 'package:gold/base/list_view_model.dart';
import 'package:gold/model/customer_model.dart';

/// @description:
/// @author tangzhentao
/// @created at 22:57 2024/12/14


class CustomerViewmodel extends ListViewModel<CustomerModel> {
  String _customerType = CustomerType.all;
  /// 客户类型 all=全部，unpaid=未消费，paid=已消费
  String get customerType => _customerType;
  set customerType(String value) {
    if (_customerType != value) {
      _customerType = value;
      firstLoad();
    }
  }

  CustomerViewmodel(super.api) {
    isLast = false;
  }

  @override
  Map<String, dynamic>? onOtherData() {
    return {'filter': {'tab': _customerType.toString()}};
  }
}

/// 客户类型 all=全部，unpaid=未消费，paid=已消费
class CustomerType {
  /// all=全部
  static const all = 'all';
  /// unpaid=未消费
  static const unpaid = 'unpaid';
  /// paid=已消费
  static const paid = 'paid';
}